// 游戏类型定义
export type Player = 'black' | 'white' | null;

export type GameMode = 'pvp' | 'ai' | null;

export type GameStatus = 'selecting' | 'playing' | 'finished';

export interface Position {
  row: number;
  col: number;
}

export interface GameState {
  board: Player[][];
  currentPlayer: Player;
  gameMode: GameMode;
  gameStatus: GameStatus;
  winner: Player;
  moveCount: number;
  lastMove: Position | null;
  winningLine: Position[];
}

export interface GameConfig {
  boardSize: number;
  winLength: number;
  aiDifficulty: number;
}

// 方向向量，用于检查五子连珠
export const DIRECTIONS = [
  { dr: 0, dc: 1 },   // 水平
  { dr: 1, dc: 0 },   // 垂直
  { dr: 1, dc: 1 },   // 主对角线
  { dr: 1, dc: -1 },  // 副对角线
] as const;

// 棋盘大小
export const BOARD_SIZE = 15;

// 星位点位置（天元、小目等）
export const STAR_POINTS = [
  { row: 3, col: 3 },
  { row: 3, col: 11 },
  { row: 11, col: 3 },
  { row: 11, col: 11 },
  { row: 7, col: 7 }, // 天元（中心）
] as const;